import pygame

class Setting:
    """游戏所有UI相关的固定参数设置"""
    def __init__(self):
        # 初始化pygame字体系统
        pygame.font.init()
        
        # 屏幕设置
        self.screen_width = 1500
        self.screen_height = 900
        self.screen_title = "Chang'an Creatures"  # 游戏标题（英文）
        self.fps = 60  # 帧率
        
        # 颜色设置
        self.color_white = (255, 255, 255)
        self.color_black = (0, 0, 0)
        self.color_red = (255, 50, 50)        # 生命值相关
        self.color_green = (50, 200, 50)      # 状态良好相关
        self.color_blue = (50, 100, 200)      # 魔法/技能相关
        self.color_yellow = (255, 215, 0)     # 选中/高亮相关
        self.color_brown = (139, 69, 19)      # 长安古风棕色
        self.color_gray = (150, 150, 150)     # 普通边框
        self.color_light_gray = (220, 220, 220) # 背景填充
        
        # 界面背景图片
        self.bg_path_start = (40, 40, 80)    # 开始界面背景
        self.bg_path_map = (101, 67, 33)     # 地图界面背景（土黄色调）
        self.bg_path_battle = (34, 139, 34)  # 战斗界面背景（草地色调）
        self.bg_path_status = (245, 245, 220)# 状态界面背景（纸张色调）
        
        # 字体设置（使用英文字体）
        self.font_default = pygame.font.SysFont(["Arial", "Helvetica", "sans-serif"], 24)
        self.font_title = pygame.font.SysFont(["Georgia", "Times New Roman", "serif"], 48)
        self.font_menu = pygame.font.SysFont(["Verdana", "Arial", "sans-serif"], 32)
        self.font_small = pygame.font.SysFont(["Arial", "Helvetica", "sans-serif"], 18)
        
        # 按钮设置
        self.btn_width = 220
        self.btn_height = 60
        self.btn_small_width = 120
        self.btn_small_height = 40
        self.btn_spacing = 25
        self.btn_radius = 5  # 圆角半径
        self.btn_normal_color = (101, 67, 33)
        self.btn_hover_color = (160, 82, 45)
        self.btn_pressed_color = (62, 39, 15)
        self.btn_text_color = self.color_white
        
        # 状态栏设置
        self.status_bar_width = 300
        self.status_bar_height = 40
        self.status_bar_padding = 5
        self.hp_bar_color = self.color_red
        self.mp_bar_color = self.color_blue
        self.exp_bar_color = self.color_yellow
        self.status_bar_bg = self.color_gray
        
        # 战斗界面布局
        self.battle_menu_height = 200  # 底部菜单高度
        self.enemy_area_rect = pygame.Rect(50, 50, 300, 250)  # 敌方位置
        self.player_area_rect = pygame.Rect(450, 200, 300, 250)  # 我方位置
        self.skill_menu_rect = pygame.Rect(0, self.screen_height - self.battle_menu_height, 
                                         self.screen_width, self.battle_menu_height)
        
        # 地图界面设置（关卡名称使用英文）
        self.level_node_size = 60
        self.level_node_spacing = 150  # 关卡节点间距
        self.level_line_color = self.color_yellow
        self.level_line_width = 3
        self.level_names = ["Zhuque St.", "Daming Palace", "Qujiang Pool", "Furong Garden", "Big Wild Goose Pagoda"]
        
        # 装备栏设置
        self.slot_size = 80
        self.slot_spacing = 15
        self.slot_border_width = 2
        self.slot_normal_border = self.color_gray
        self.slot_selected_border = self.color_yellow
        
        # 技能窗口设置
        self.skill_window_width = 1000
        self.skill_window_height = 100
        self.skill_item_width = 140
        self.skill_item_height = 60
        self.skill_grid_spacing = 10
        
        #背景图片路径
        self.images_path = {
            "start_background": "image/enter_bg.jpg",
            "map_background": "image/map.png",
            "battle_background": "image/battle_bg.jpg",
            "select_background": "image/select_bg.jpg",
            "hit_effect": "image/hit.png",
            "intro_background": "image/intro_bg.jpg",
            "hiden_charactor": "image/hiden_charactor.png"
        }
        
        #按钮背景路径
        self.button_images_path = {
            "start_ui_button": "image/start_ui_button.png",
        }
        
        #标题路径
        self.title_images_path = {
            "start_title": "image/title.png",
            "select_title": "image/select_title.png"
        }
        
